<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" class="a">+<input type="text" class="b">=<button class="c">点击查看结果</button>
    <script>
        // 2.计算两个文本框的加减乘除 文本框 + 文本框 按钮（=） 文本框（结果） 提示：可以通过 input.value = "值" 来设置 input里的值
        var one = document.getElementsByClassName("a")[0];
        var two = document.getElementsByClassName("b")[0];
        var three = document.getElementsByClassName("c")[0];
        three.onclick = function(){
            var onea = one.value;
            var oneb = two.value;
            var anwser = Number(onea) + Number(oneb);
            alert(anwser);
        }
    </script>
</body>
</html>